package com.huatai.bi.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;

@TableName("tb_database")
@ApiModel(value = "数据源连接基本信息",description = "数据源连接基本信息")
@Data
public class DatabaseEntity {

	@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
	@TableId(value = "id",type = IdType.ASSIGN_ID)
	@ApiModelProperty("主键")
	private Long id;

	@TableField(value = "type")
	@ApiModelProperty(value = "类型   MYSQL  ORACLE  高斯")
	@NotBlank(message = "类型不能为空")
	private String type;

	@TableField(value = "name")
	@ApiModelProperty(value = "连接名称")
	@NotBlank(message = "连接名称不能为空")
	private String name;

	@TableField(value = "driver")
	@ApiModelProperty(value = "驱动")
	@NotBlank(message = "驱动不能为空")
	private String driver;

	@TableField(value = "user_name")
	@ApiModelProperty(value = "用户名")
	@NotBlank(message = "用户名不能为空")
	private String userName;

	@TableField(value = "password")
	@ApiModelProperty(value = "密码")
	@NotBlank(message = "密码不能为空")
	private String password;

	@TableField(value = "jdbc_url")
	@ApiModelProperty(value = "JDBC连接信息")
	@NotBlank(message = "JDBC连接信息不能为空")
	private String jdbcUrl;

	@TableField(value = "encode")
	@ApiModelProperty("编码")
	private String encode;
}
